import Taro, { Component } from '@tarojs/taro'
// 引入 Swiper, SwiperItem 组件
import { Swiper, SwiperItem, View, Image } from '@tarojs/components'
import { useSelector } from 'react-redux'

import './cookbook.scss'

function Index(props) {
  const list = useSelector(state => state.index.list)

  return (
    <View className="swiper-wrap">
      <Swiper
        className='test-h'
        indicatorColor='rgba(255, 255, 255, 0.6)'
        indicatorActiveColor='#fff'
        circular
        indicatorDots
        autoplay>
        {
          list.slice(0, 5).map(li => {
            return (
              <SwiperItem>
                <Image className="img" src={li.img}></Image>
              </SwiperItem>
            )
          })
        }
      </Swiper>
    </View>
  )
}

export default Index